home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / What's New? / Development Kits / Speech Recognition Mgr 1.5 / SR 1.5 Interfaces & Lib / SpeechRecognition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  21.0 KB  |  495 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        SpeechRecognition.h
  3.  
  4.      Contains:    Apple Speech Recognition Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    PlainTalk 1.5
  7.  
  8.                  Release:    PlainTalk Developer Release
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.  
  12.                  All rights reserved.
  13.  
  14.      Bugs?:        If you find a problem with this file, send the file and version
  15.                  information (from above) and the problem description to:
  16.  
  17.                      Internet:    apple.bugs@applelink.apple.com
  18.                      AppleLink:    APPLE.BUGS
  19.  
  20. */
  21. #ifndef __SPEECHRECOGNITION__
  22. #define __SPEECHRECOGNITION__
  23.  
  24. #ifndef __MEMORY__
  25. #include <Memory.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if PRAGMA_IMPORT_SUPPORTED
  33. #pragma import on
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40.  
  41. enum {
  42.     gestaltSpeechRecognitionVersion = 'srtb',
  43.     gestaltSpeechRecognitionAttr = 'srta'
  44. };
  45.  
  46.  
  47. enum {
  48.     gestaltDesktopSpeechRecognition = 1L << 0,
  49.     gestaltTelephoneSpeechRecognition = 1L << 1
  50. };
  51.  
  52. /* Error Codes [Speech recognition gets -5100 through -5199] */
  53.  
  54. enum {
  55.     kSRNotAvailable                = -5100,                        /* the service requested is not avail or applicable */
  56.     kSRInternalError            = -5101,                        /* a system internal or hardware error condition */
  57.     kSRComponentNotFound        = -5102,                        /* a needed system resource was not located */
  58.     kSROutOfMemory                = -5103,                        /* an out of memory error occurred in the toolbox memory space */
  59.     kSRNotASpeechObject            = -5104,                        /* the object specified is no longer or never was valid */
  60.     kSRBadParameter                = -5105,                        /* an invalid parameter was specified */
  61.     kSRParamOutOfRange            = -5106,                        /* when we say 0-100, don't pass in 101. */
  62.     kSRBadSelector                = -5107,                        /* an unrecognized selector was specified */
  63.     kSRBufferTooSmall            = -5108,                        /* returned from attribute access functions */
  64.     kSRNotARecSystem            = -5109,                        /* the object used was not a SRRecognitionSystem */
  65.     kSRFeedbackNotAvail            = -5110,                        /* there is no feedback window associated with SRRecognizer */
  66.     kSRCantSetProperty            = -5111,                        /* a non-settable property was specified */
  67.     kSRCantGetProperty            = -5112,                        /* a non-gettable property was specified */
  68.     kSRCantSetDuringRecognition    = -5113,                        /* the property can't be set while recognition is in progress -- do before or between utterances. */
  69.     kSRAlreadyListening            = -5114,                        /* in response to SRStartListening */
  70.     kSRNotListeningState        = -5115,                        /* in response to SRStopListening */
  71.     kSRModelMismatch            = -5116,                        /* no acoustical models are avail to match request */
  72.     kSRNoClientLanguageModel    = -5117,                        /* trying to access a non-specified SRLanguageModel */
  73.     kSRNoPendingUtterances        = -5118,                        /* nothing to continue search on */
  74.     kSRRecognitionCanceled        = -5119,                        /* an abort error occurred during search */
  75.     kSRRecognitionDone            = -5120,                        /* search has finished, but nothing was recognized */
  76.     kSROtherRecAlreadyModal        = -5121,                        /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
  77.     kSRHasNoSubItems            = -5122,                        /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
  78.     kSRSubItemNotFound            = -5123,                        /* returned when accessing a non-existent sub item of a container */
  79.     kSRLanguageModelTooBig        = -5124,                        /* Cant build language models so big */
  80.     kSRAlreadyReleased            = -5125,                        /* this object has already been released before */
  81.     kSRAlreadyFinished            = -5126,                        /* the language model can't be finished twice */
  82.     kSRWordNotFound                = -5127,                        /* the spelling couldn't be found in lookup(s) */
  83.     kSRNotFinishedWithRejection    = -5128,                        /* property not found because the LMObj is not finished with rejection */
  84.     kSRExpansionTooDeep            = -5129,                        /* Language model is left recursive or is embedded too many levels */
  85.     kSRTooManyElements            = -5130,                        /* Too many elements added to phrase or path or other langauge model object */
  86.     kSRCantAdd                    = -5131,                        /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    */
  87.     kSRSndInSourceDisconnected    = -5132,                        /* Sound input source is disconnected */
  88.     kSRCantReadLanguageObject    = -5133,                        /* An error while trying to create new Language object from file or pointer -- possibly bad format */
  89.                                                                 /* non-release debugging error codes are included here */
  90.     kSRNotImplementedYet        = -5199                            /* you'd better wait for this feature in a future release */
  91. };
  92.  
  93. /* Type Definitions */
  94. typedef struct OpaqueSRSpeechObject* SRSpeechObject;
  95. typedef SRSpeechObject SRRecognitionSystem;
  96. typedef SRSpeechObject SRRecognizer;
  97. typedef SRSpeechObject SRSpeechSource;
  98. typedef SRSpeechSource SRRecognitionResult;
  99. typedef SRSpeechObject SRLanguageObject;
  100. typedef SRLanguageObject SRLanguageModel;
  101. typedef SRLanguageObject SRPath;
  102. typedef SRLanguageObject SRPhrase;
  103. typedef SRLanguageObject SRWord;
  104. typedef unsigned long SRLanguageObjectFlags;
  105. /* between 0 and 100 */
  106. typedef unsigned short SRSpeedSetting;
  107. /* between 0 and 100 */
  108. typedef unsigned short SRRejectionLevel;
  109. /* When an event occurs, the user supplied proc will be called with a pointer    */
  110. /*    to the param passed in and a flag to indicate conditions such                */
  111. /*    as interrupt time or system background time.                                */
  112. struct SRCallBackStruct {
  113.     long                             what;                        /* one of notification flags */
  114.     long                             message;                    /* contains SRRecognitionResult id */
  115.     SRRecognizer                     instance;                    /* ID of recognizer being notified */
  116.     OSErr                             status;                        /* result status of last search */
  117.     short                             flags;                        /* non-zero if occurs during interrupt */
  118.     long                             refCon;                        /* user defined - set from SRCallBackParam */
  119. };
  120. typedef struct SRCallBackStruct SRCallBackStruct;
  121.  
  122. /* Call back procedure definition */
  123. typedef pascal void (*SRCallBackProcPtr)(SRCallBackStruct *param);
  124.  
  125. #if GENERATINGCFM
  126. typedef UniversalProcPtr SRCallBackUPP;
  127. #else
  128. typedef SRCallBackProcPtr SRCallBackUPP;
  129. #endif
  130.  
  131. enum {
  132.     uppSRCallBackProcInfo = kPascalStackBased
  133.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SRCallBackStruct *)))
  134. };
  135.  
  136. #if GENERATINGCFM
  137. #define NewSRCallBackProc(userRoutine)        \
  138.         (SRCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSRCallBackProcInfo, GetCurrentArchitecture())
  139. #else
  140. #define NewSRCallBackProc(userRoutine)        \
  141.         ((SRCallBackUPP) (userRoutine))
  142. #endif
  143.  
  144. #if GENERATINGCFM
  145. #define CallSRCallBackProc(userRoutine, param)        \
  146.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSRCallBackProcInfo, (param))
  147. #else
  148. #define CallSRCallBackProc(userRoutine, param)        \
  149.         (*(userRoutine))((param))
  150. #endif
  151. struct SRCallBackParam {
  152.     SRCallBackUPP                     callBack;
  153.     long                             refCon;
  154. };
  155. typedef struct SRCallBackParam SRCallBackParam;
  156.  
  157. /* Recognition System Types */
  158.  
  159. enum {
  160.     kSRDefaultRecognitionSystemID = 0
  161. };
  162.  
  163. /* Recognition System Properties */
  164.  
  165. enum {
  166.     kSRFeedbackAndListeningModes = 'fbwn',                        /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
  167.     kSRRejectedWord                = 'rejq',                        /* the SRWord used to represent a rejection */
  168.     kSRCleanupOnClientExit        = 'clup'                        /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
  169. };
  170.  
  171.  
  172. enum {
  173.     kSRNoFeedbackNoListenModes    = 0,                            /* next allocated recognizer has no feedback window and doesn't use listening modes    */
  174.     kSRHasFeedbackHasListenModes = 1,                            /* next allocated recognizer has feedback window and uses listening modes             */
  175.     kSRNoFeedbackHasListenModes    = 2                                /* next allocated recognizer has no feedback window but does use listening modes     */
  176. };
  177.  
  178. /* Speech Source Types */
  179.  
  180. enum {
  181.     kSRDefaultSpeechSource        = 0,
  182.     kSRLiveDesktopSpeechSource    = 'dklv',                        /* live desktop sound input */
  183.     kSRCanned22kHzSpeechSource    = 'ca22'                        /* AIFF file based 16 bit, 22.050 KHz sound input */
  184. };
  185.  
  186. /* Notification via Apple Event or Callback */
  187. /* Notification Flags */
  188.  
  189. enum {
  190.     kSRNotifyRecognitionBeginning = 1L << 0,                    /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
  191.     kSRNotifyRecognitionDone    = 1L << 1                        /* recognition has terminated. result (if any) is available. */
  192. };
  193.  
  194. /* Apple Event selectors */
  195. /* AppleEvent message class  */
  196.  
  197. enum {
  198.     kAESpeechSuite                = 'sprc'
  199. };
  200.  
  201. /* AppleEvent message event ids */
  202.  
  203. enum {
  204.     kAESpeechDone                = 'srsd',
  205.     kAESpeechDetected            = 'srbd'
  206. };
  207.  
  208. /* AppleEvent Parameter ids */
  209.  
  210. enum {
  211.     keySRRecognizer                = 'krec',
  212.     keySRSpeechResult            = 'kspr',
  213.     keySRSpeechStatus            = 'ksst'
  214. };
  215.  
  216. /* AppleEvent Parameter types */
  217.  
  218. enum {
  219.     typeSRRecognizer            = 'trec',
  220.     typeSRSpeechResult            = 'tspr'
  221. };
  222.  
  223. /* SRRecognizer Properties */
  224.  
  225. enum {
  226.     kSRNotificationParam        = 'noti',                        /* see notification flags below */
  227.     kSRCallBackParam            = 'call',                        /* type SRCallBackParam */
  228.     kSRSearchStatusParam        = 'stat',                        /* see status flags below */
  229.     kSRAutoFinishingParam        = 'afin',                        /* automatic finishing applied on LM for search */
  230.     kSRForegroundOnly            = 'fgon',                        /* Boolean. Default is true. If true, client recognizer only active when in foreground.    */
  231.     kSRBlockBackground            = 'blbg',                        /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    */
  232.     kSRBlockModally                = 'blmd',                        /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
  233.     kSRWantsResultTextDrawn        = 'txfb',                        /* Boolean. Default is true. If true, search results are posted to Feedback window */
  234.     kSRWantsAutoFBGestures        = 'dfbr',                        /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
  235.     kSRSoundInVolume            = 'volu',                        /* short in [0..100] log scaled sound input power. Can't set this property */
  236.     kSRReadAudioFSSpec            = 'aurd',                        /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
  237.     kSRCancelOnSoundOut            = 'caso',                        /* Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. */
  238.     kSRSpeedVsAccuracyParam        = 'sped'                        /* SRSpeedSetting between 0 and 100 */
  239. };
  240.  
  241. /* 0 means more accurate but slower. */
  242. /* 100 means (much) less accurate but faster. */
  243.  
  244. enum {
  245.     kSRUseToggleListen            = 0,                            /* listen key modes */
  246.     kSRUsePushToTalk            = 1
  247. };
  248.  
  249.  
  250. enum {
  251.     kSRListenKeyMode            = 'lkmd',                        /* short: either kSRUseToggleListen or kSRUsePushToTalk */
  252.     kSRListenKeyCombo            = 'lkey',                        /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */
  253.     kSRListenKeyName            = 'lnam',                        /* Str63: string representing ListenKeyCombo */
  254.     kSRKeyWord                    = 'kwrd',                        /* Str255: keyword preceding spoken commands in kSRUseToggleListen mode */
  255.     kSRKeyExpected                = 'kexp'                        /* Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? */
  256. };
  257.  
  258. /* Operational Status Flags */
  259.  
  260. enum {
  261.     kSRIdleRecognizer            = 1L << 0,                        /* engine is not active */
  262.     kSRSearchInProgress            = 1L << 1,                        /* search is in progress */
  263.     kSRSearchWaitForAllClients    = 1L << 2,                        /* search is suspended waiting on all clients' input */
  264.     kSRMustCancelSearch            = 1L << 3,                        /* something has occurred (sound played, non-speech detected) requiring the search to abort */
  265.     kSRPendingSearch            = 1L << 4                        /* we're about to start searching */
  266. };
  267.  
  268. /* Recognition Result Properties */
  269.  
  270. enum {
  271.     kSRTEXTFormat                = 'TEXT',                        /* raw text in user supplied memory */
  272.     kSRPhraseFormat                = 'lmph',                        /* SRPhrase containing result words */
  273.     kSRPathFormat                = 'lmpt',                        /* SRPath containing result phrases or words */
  274.     kSRLanguageModelFormat        = 'lmfm'                        /* top level SRLanguageModel for post parse */
  275. };
  276.  
  277. /* SRLanguageObject Family Properties */
  278.  
  279. enum {
  280.     kSRSpelling                    = 'spel',                        /* spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel */
  281.     kSRLMObjType                = 'lmtp',                        /* Returns one of SRLanguageObject Types listed below */
  282.     kSRRefCon                    = 'refc',                        /* 4 bytes of user storage */
  283.     kSROptional                    = 'optl',                        /* Boolean -- true if SRLanguageObject is optional    */
  284.     kSREnabled                    = 'enbl',                        /* Boolean -- true if SRLanguageObject enabled */
  285.     kSRRepeatable                = 'rptb',                        /* Boolean -- true if SRLanguageObject is repeatable */
  286.     kSRRejectable                = 'rjbl',                        /* Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord */
  287.                                                                 /*        object can be returned in place of SRLanguageObject with this property)    */
  288.     kSRRejectionLevel            = 'rjct',                        /* SRRejectionLevel between 0 and 100 */
  289.     kSRFinishingFlags            = 'finf'                        /* Please use kSROptional, kSRRepeatable, and kRejetable instead. pass pointer to SRLanguageObjectFlags. Being phased out of public interfaces. */
  290. };
  291.  
  292. /* LM Object Types -- returned as kSRLMObjType property of language model objects */
  293.  
  294. enum {
  295.     kSRLanguageModelType        = 'lmob',                        /* SRLanguageModel */
  296.     kSRPathType                    = 'path',                        /* SRPath */
  297.     kSRPhraseType                = 'phra',                        /* SRPhrase */
  298.     kSRWordType                    = 'word'                        /* SRWord */
  299. };
  300.  
  301. /* a normal and reasonable rejection level */
  302.  
  303. enum {
  304.     kSRDefaultRejectionLevel    = 50
  305. };
  306.  
  307. /* Finishing Flags - used to make up SRLanguageObjectFlags, which is used for kSRFinishingFlags and kSRAutoFinishingParam properties  */
  308. /* 4/10/95 These finishing flags are being phased out of the public interfaces.  Please use kSROptional, kSRRepeatable, */
  309. /*    and kSRRejectable Boolean SRLanguageObject properties instead.  Those Boolean properties are easier to use.            */
  310.  
  311. enum {
  312.                                                                 /* bit zero is reserved */
  313.     kSRAddPauses                = 1L << 1,                        /* allows user to pause between words */
  314.     kSRAddRejection                = 1L << 2,                        /* unrecognized words will be rejected */
  315.     kSRAddNoise                    = 1L << 3,                        /* allows a some noise at beginning or end of utterance */
  316.     kSRMakeOptional                = 1L << 4,                        /* contents of LM are optional */
  317.     kSRMakeRepeatable            = 1L << 5                        /* contents of LM may be repeated 0 or more times */
  318. };
  319.  
  320.  
  321. enum {
  322.     kSRAddWordSpotting            = (kSRAddRejection | kSRMakeRepeatable),
  323.     kSRDefaultFinishing            = kSRAddPauses,
  324.     kSRNoFinishing                = 0
  325. };
  326.  
  327. /********************************************************************************/
  328. /*                        NOTES ON USING THE API                                    */
  329. /*                                                                                */
  330. /*        All operations (with the exception of SRGetRecognitionSystem) are        */
  331. /*        directed toward an object allocated or begot from New, Get and Read        */
  332. /*        type calls.                                                                */
  333. /*                                                                                */
  334. /*        There is a simple rule in dealing with allocation and disposal:            */
  335. /*                                                                                */
  336. /*        *    all toolbox allocations are obtained from a SRRecognitionSystem        */
  337. /*                                                                                */
  338. /*        *    if you obtain an object via New or Get, then you own a reference     */
  339. /*            to that object and it must be released via SRReleaseObject when        */
  340. /*            you no longer need it                                                */
  341. /*                                                                                */
  342. /*        *    when you receive a SRRecognitionResult object via AppleEvent or        */
  343. /*            callback, it has essentially been created on your behalf and so        */
  344. /*            you are responsible for releasing it as above                        */
  345. /*                                                                                */
  346. /*        *    when you close a SRRecognitionSystem, all remaining objects which        */
  347. /*            were allocated with it will be forcefully released and any            */
  348. /*            remaining references to those objects will be invalid.                */
  349. /*                                                                                */
  350. /*        This translates into a very simple guideline:                            */
  351. /*            If you allocate it or have it allocated for you, you must release    */
  352. /*            it.  If you are only peeking at it, then don't release it.            */
  353. /*                                                                                */
  354. /********************************************************************************/
  355. /* Opening and Closing of the SRRecognitionSystem */
  356. extern pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  357.  THREEWORDINLINE(0x303C, 0x0400, 0xAA56);
  358.  
  359. extern pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  360.  THREEWORDINLINE(0x303C, 0x0201, 0xAA56);
  361.  
  362. /* Accessing Properties of any Speech Object */
  363. extern pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  364.  THREEWORDINLINE(0x303C, 0x0802, 0xAA56);
  365.  
  366. extern pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  367.  THREEWORDINLINE(0x303C, 0x0803, 0xAA56);
  368.  
  369. /* Any object obtained via New or Get type calls must be released */
  370. extern pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  371.  THREEWORDINLINE(0x303C, 0x0204, 0xAA56);
  372.  
  373. extern pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  374.  THREEWORDINLINE(0x303C, 0x0425, 0xAA56);
  375.  
  376. /* SRRecognizer Instance Functions */
  377. extern pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *recognizer, OSType sourceID)
  378.  THREEWORDINLINE(0x303C, 0x060A, 0xAA56);
  379.  
  380. extern pascal OSErr SRStartListening(SRRecognizer recognizer)
  381.  THREEWORDINLINE(0x303C, 0x020C, 0xAA56);
  382.  
  383. extern pascal OSErr SRStopListening(SRRecognizer recognizer)
  384.  THREEWORDINLINE(0x303C, 0x020D, 0xAA56);
  385.  
  386. extern pascal OSErr SRSetLanguageModel(SRRecognizer recognizer, SRLanguageModel languageModel)
  387.  THREEWORDINLINE(0x303C, 0x040E, 0xAA56);
  388.  
  389. extern pascal OSErr SRGetLanguageModel(SRRecognizer recognizer, SRLanguageModel *languageModel)
  390.  THREEWORDINLINE(0x303C, 0x040F, 0xAA56);
  391.  
  392. extern pascal OSErr SRContinueRecognition(SRRecognizer recognizer)
  393.  THREEWORDINLINE(0x303C, 0x0210, 0xAA56);
  394.  
  395. extern pascal OSErr SRCancelRecognition(SRRecognizer recognizer)
  396.  THREEWORDINLINE(0x303C, 0x0211, 0xAA56);
  397.  
  398. extern pascal OSErr SRIdle(void )
  399.  THREEWORDINLINE(0x303C, 0x0028, 0xAA56);
  400.  
  401. /* Language Model Building and Manipulation Functions */
  402. extern pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  403.  THREEWORDINLINE(0x303C, 0x0812, 0xAA56);
  404.  
  405. extern pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  406.  THREEWORDINLINE(0x303C, 0x0413, 0xAA56);
  407.  
  408. extern pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  409.  THREEWORDINLINE(0x303C, 0x0814, 0xAA56);
  410.  
  411. extern pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  412.  THREEWORDINLINE(0x303C, 0x0815, 0xAA56);
  413.  
  414. /* Operations on any object of the SRLanguageObject family */
  415. extern pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject languageObject, Handle lobjHandle)
  416.  THREEWORDINLINE(0x303C, 0x0416, 0xAA56);
  417.  
  418. extern pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject languageObject, short fRefNum)
  419.  THREEWORDINLINE(0x303C, 0x0328, 0xAA56);
  420.  
  421. extern pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *languageObject, Handle lObjHandle)
  422.  THREEWORDINLINE(0x303C, 0x0417, 0xAA56);
  423.  
  424. extern pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *languageObject, short fRefNum)
  425.  THREEWORDINLINE(0x303C, 0x0427, 0xAA56);
  426.  
  427. extern pascal OSErr SREmptyLanguageObject(SRLanguageObject languageObject)
  428.  THREEWORDINLINE(0x303C, 0x0218, 0xAA56);
  429.  
  430. extern pascal OSErr SRChangeLanguageObject(SRLanguageObject languageObject, const void *text, Size textLength)
  431.  THREEWORDINLINE(0x303C, 0x0619, 0xAA56);
  432.  
  433. extern pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  434.  THREEWORDINLINE(0x303C, 0x041A, 0xAA56);
  435.  
  436. extern pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  437.  THREEWORDINLINE(0x303C, 0x081B, 0xAA56);
  438.  
  439. extern pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  440.  THREEWORDINLINE(0x303C, 0x041C, 0xAA56);
  441.  
  442. /* Traversing SRRecognitionResults or SRLanguageObjects */
  443. extern pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  444.  THREEWORDINLINE(0x303C, 0x0405, 0xAA56);
  445.  
  446. extern pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  447.  THREEWORDINLINE(0x303C, 0x0606, 0xAA56);
  448.  
  449. extern pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  450.  THREEWORDINLINE(0x303C, 0x0607, 0xAA56);
  451.  
  452. extern pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  453.  THREEWORDINLINE(0x303C, 0x0408, 0xAA56);
  454.  
  455. /* Utilizing the System Feedback Window */
  456. extern pascal OSErr SRDrawText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  457.  THREEWORDINLINE(0x303C, 0x0621, 0xAA56);
  458.  
  459. extern pascal OSErr SRDrawRecognizedText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  460.  THREEWORDINLINE(0x303C, 0x0622, 0xAA56);
  461.  
  462. extern pascal OSErr SRSpeakText(SRRecognizer recognizer, const void *speakText, Size speakLength)
  463.  THREEWORDINLINE(0x303C, 0x0620, 0xAA56);
  464.  
  465. extern pascal OSErr SRSpeakAndDrawText(SRRecognizer recognizer, const void *text, Size textLength)
  466.  THREEWORDINLINE(0x303C, 0x061F, 0xAA56);
  467.  
  468. extern pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  469.  THREEWORDINLINE(0x303C, 0x0223, 0xAA56);
  470.  
  471. extern pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  472.  THREEWORDINLINE(0x303C, 0x0224, 0xAA56);
  473.  
  474. extern pascal OSErr SRProcessBegin(SRRecognizer recognizer, Boolean failed)
  475.  THREEWORDINLINE(0x303C, 0x031D, 0xAA56);
  476.  
  477. extern pascal OSErr SRProcessEnd(SRRecognizer recognizer, Boolean failed)
  478.  THREEWORDINLINE(0x303C, 0x031E, 0xAA56);
  479.  
  480.  
  481. #if PRAGMA_ALIGN_SUPPORTED
  482. #pragma options align=reset
  483. #endif
  484.  
  485. #if PRAGMA_IMPORT_SUPPORTED
  486. #pragma import off
  487. #endif
  488.  
  489. #ifdef __cplusplus
  490. }
  491. #endif
  492.  
  493. #endif /* __SPEECHRECOGNITION__ */
  494.  
  495.